#ifndef __LCDINIT_H
#define	__LCDINIT_H

#include "main.h"
#define io_writ 0
#define io_read 1

#define GC9A01_CMD_CASETF 0x2A
#define GC9A01_CMD_RASETF 0x2B
#define GC9A01_CMD_RAMWR  0x2C

#define LCD_CSHigh()         GPIOA->BSRR = SPI_CS_Pin
#define LCD_CSLow()          GPIOA->BRR = SPI_CS_Pin
#define LCD_SDAHigh()        GPIOA->BSRR = SPI_MOSI_Pin
#define LCD_SDALow()         GPIOA->BRR = SPI_MOSI_Pin
#define LCD_SCLHigh()        GPIOC->BSRR  = SPI_SCL_Pin
#define LCD_SCLLow()         GPIOC->BRR  = SPI_SCL_Pin 
#define LCD_DCXHigh()        GPIOC->BSRR = SPI_DCX_Pin
#define LCD_DCXLow()         GPIOC->BRR = SPI_DCX_Pin
#define LCD_RSTHigh()        GPIOA->BSRR = LCD_RESET_Pin  
#define LCD_RSTLow()         GPIOA->BRR = LCD_RESET_Pin


/*#define LCD_CSHigh()         {    GPIOA->ODR = GPIOA->ODR | 1<<5 ;     }
#define LCD_CSLow()          {    GPIOA->ODR = GPIOA->ODR & 0XFFFFFFDF ;     }
#define LCD_SDAHigh()        {    GPIOA->ODR = GPIOA->ODR | 1<<7 ;     }
#define LCD_SDALow()         {    GPIOA->ODR = GPIOA->ODR & 0XFFFFFF7F ;     }
#define LCD_SCLHigh()        {    GPIOC->ODR = GPIOC->ODR | 1<<4 ;     }
#define LCD_SCLLow()         {    GPIOC->ODR = GPIOC->ODR & 0XFFFFFFEF ;     }
#define LCD_DCXHigh()        {    GPIOC->ODR = GPIOC->ODR | 1<<5 ;     }
#define LCD_DCXLow()         {    GPIOC->ODR = GPIOC->ODR & 0XFFFFFFDF ;     }
#define LCD_RSTHigh()        {    GPIOA->ODR = GPIOA->ODR | 1<<4 ;     }  
#define LCD_RSTLow()         {    GPIOA->ODR = GPIOA->ODR & 0XFFFFFFEF ;     } */  

void wr_cmd_4spi_8bcs(uint8_t par);
void wr_dat_4spi_8bcs(uint8_t par);

void wr_num(uint8_t par);
void wr_c2c();
void C222LAA_Init(void);
//void Filllcd_Area(uint16_t _usX, uint16_t _usY, uint16_t _usWidth , uint16_t _usHeight, uint16_t color);
void Filllcd_Area(uint16_t color);

#endif